package com.ftqh.tutorial.web.vo;

public enum ResponseStatus {

    SUCCESS(true, "OK"),
    FAIL(false, "Fail");

    private final boolean value;

    private final String descPhrase;


    ResponseStatus(boolean value, String descPhrase) {
        this.value = value;
        this.descPhrase = descPhrase;
    }

    public boolean value() {
        return this.value;
    }

    public String getDescPhrase() {
        return this.descPhrase;
    }

    public String toString() {
        return Boolean.toString(this.value);
    }

    public static ResponseStatus valueOf(boolean statusValue) {
        for (ResponseStatus status : values()) {
            if (status.value == statusValue) {
                return status;
            }
        }
        throw new IllegalArgumentException("No matching constant for [" + statusValue + "]");
    }
}
